package future;

public class Client {
	
	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		Server server = new Server();
		DataFuture<String> dataFuture = server.getData();
		
		try {
			// 先执行其他操作
			Thread.sleep(5000);
			// 模拟耗时...
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		System.out.print("结果数据：" + dataFuture.getRealData());
		System.out.println("耗时: " + (System.currentTimeMillis() - start));
	}
}

